package com.newdjk.newdoctor.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.appcompat.widget.AppCompatButton;

import com.newdjk.newdoctor.BasActivity;
import com.newdjk.newdoctor.R;
import com.newdjk.newdoctor.utils.Contants;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ChooseRegisterActivity extends BasActivity {
    @BindView(R.id.lv_linshou)
    LinearLayout lvLinshou;
    @BindView(R.id.lv_jiceng)
    LinearLayout lvJiceng;
    @BindView(R.id.im_lingshou)
    ImageView imLingshou;
    @BindView(R.id.im_jiceng)
    ImageView imJiceng;
    @BindView(R.id.btn_nextstep)
    AppCompatButton btnNextstep;
    private int refisterType=1;

    @Override
    public boolean IsShowBackIcon() {
        return true;
    }

    @Override
    protected String setTitle() {
        return "机构类型";
    }

    @Override
    protected int initViewResId() {
        return R.layout.activity_choose_register;
    }

    @Override
    protected void initListener() {
        lvLinshou.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                lvLinshou.setBackgroundResource(R.drawable.shape_choose_registertype_check);
                lvJiceng.setBackgroundResource(R.drawable.shape_choose_registertype);
                imLingshou.setImageResource(R.drawable.registered_check);
                imJiceng.setImageResource(R.drawable.registered_notcheck);
                refisterType=1;
            }
        });
        lvJiceng.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                lvJiceng.setBackgroundResource(R.drawable.shape_choose_registertype_check);
                lvLinshou.setBackgroundResource(R.drawable.shape_choose_registertype);
                imJiceng.setImageResource(R.drawable.registered_check);
                imLingshou.setImageResource(R.drawable.registered_notcheck);
                refisterType=0;
            }
        });


        btnNextstep.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(ChooseRegisterActivity.this,RegisterActivity.class);
                intent.putExtra(Contants.refisterType,refisterType);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
